package com.ruicar.afs.cloud.common.modules.dto.mq.loan.contractdto;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.ruicar.afs.cloud.common.core.enums.AfsEnumDeserializer;
import com.ruicar.afs.cloud.common.core.enums.AfsEnumSerializer;
import com.ruicar.afs.cloud.common.modules.afscorebusiness.enums.*;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @param
 * @author yk.Li
 * @description 合同主数据
 * @date 2020/7/8
 */
@Data
public class ContractMainInfoDTO {
    /**
     * 合同号码
     */
    @JSONField(name = "contractNo")
    private String contractNo;
    /**
     * 客户号
     */
    @JSONField(name = "custNo")
    private Long id;
    /**
     * 业务类型
     */
    @JSONField(name = "businessType", serializeUsing = AfsEnumSerializer.class, deserializeUsing = AfsEnumDeserializer.class)
    private BusinessTypeEnum businessType;
    /**
     * 车辆属性
     */
    @JSONField(name = "carNature", serializeUsing = AfsEnumSerializer.class, deserializeUsing = AfsEnumDeserializer.class)
    private CarNatureEnum carNature;
    /**
     * 申请单号
     */
    @JSONField(name = "applyNo")
    private String applyNo;
    /**
     * 合同状态 枚举值：合同取消、合同生效、正常结清、提前结清、核销
     */
    @JSONField(name = "contractStatus", serializeUsing = AfsEnumSerializer.class, deserializeUsing = AfsEnumDeserializer.class)
    private ContractStatusEnum contractStatus;
    /**
     * 合同放款模式
     */
    @JSONField(name = "loanModel", serializeUsing = AfsEnumSerializer.class, deserializeUsing = AfsEnumDeserializer.class)
    private LoanModelEnum lendingMode;
    /**
     * 合同取消日期
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JSONField(name = "cancelDate")
    private Date cancelDate;
    /**
     * 合同到期日期
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JSONField(name = "endDate")
    private Date endDate;
    /**
     * 合同激活时间
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JSONField(name = "startDate")
    private Date startDate;
    /**
     * 合同放款时间
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JSONField(name = "loanDate")
    private Date loanDate;
    /**
     * 合同结清日期
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JSONField(name = "settleDate")
    private Date settleDate;
    /**
     * 合同关闭日期
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JSONField(name = "closeDate")
    private Date closeDate;
    /**
     * 进件首次提交日期
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JSONField(name = "intoFirstDate")
    private Date intoFirstDate;
    /**
     * 放款通过日期
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JSONField(name = "lendPassDate")
    private Date lendingPassDate;
    /**
     * 产品编号
     */
    @JSONField(name = "productId")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long productId;
    /**
     * 产品名称
     */
    @JSONField(name = "productName")
    private String productName;
    /**
     * 宽限期天数
     */
    @JSONField(name = "gracePeriodDays")
    private Integer gracePeriodDays;
    /**
     * 渠道名称
     */
    @JSONField(name = "channelName")
    private String channelName;
    /**
     * 渠道类型
     */
    @JSONField(name = "channelType", serializeUsing = AfsEnumSerializer.class, deserializeUsing = AfsEnumDeserializer.class)
    private ChannelTypeEnum channelType;

    /**
     * 渠道ID
     */
    @JSONField(name = "channelId")
    private Long channelId;
}
